<%@ include file="/common/taglibs.jsp"%>

<title><fmt:message key="agendaForm.title"/></title>
<content tag="heading"><fmt:message key="agendaForm.heading"/></content>

<spring:bind path="agenda.*">
    <c:if test="${not empty status.errorMessages}">
    <div class="error">    
        <c:forEach var="error" items="${status.errorMessages}">
            <img src="<c:url value="/images/iconWarning.gif"/>"
                alt="<fmt:message key="icon.warning"/>" class="icon" />
            <c:out value="${error}" escapeXml="false"/><br />
        </c:forEach>
    </div>
    </c:if>
</spring:bind>

<c:set var="buttons">
    <input type="submit" class="button" name="save"  onclick="bCancel=false" value="<fmt:message key="button.save"/>" />
    <input type="submit" class="button" name="delete" onclick="bCancel=true;return confirmDelete('Agenda')" value="<fmt:message key="button.delete"/>" />
    <input type="submit" class="button" name="mail" onclick="bCancel=false;return confirmSendMail()" value="<fmt:message key="button.mail"/>" />
    <input type="button" class="button" name="check" onclick="bCancel=false;checkRole(agendaForm)" 
	   value="<fmt:message key="button.check"/>" />
    <input type="button" class="button" onclick="location.href='<c:url value="/agendas.html"/>'"
	   value="<fmt:message key="button.cancel"/>" />
</c:set>

<spring:htmlEscape defaultHtmlEscape="true"/>
<form:form commandName="agenda" method="post" action="editAgenda.html"  
    id="agendaForm" name="agendaForm">
<ul>
    <form:hidden path="id"/>
    <li class="buttonBar bottom">
	<c:out value="${buttons}" escapeXml="false"/>
    </li>
    <li>
	<div>
            <div class="left">
		<toastmaster:label styleClass="desc" key="agenda.venue"/>
		<form:errors path="venue" cssClass="fieldError"/>
		<form:input path="venue" id="venue" cssClass="text medium"/>
	    </div>
	    <div>
		<toastmaster:label styleClass="desc" key="agenda.date"/>
		<form:errors path="date" cssClass="fieldError"/>
		<form:input path="date" id="date" cssClass="text medium"/>
	    </div>
	</div>
    </li>
    <li>
		<toastmaster:label styleClass="desc" key="agenda.theme"/>
		<form:errors path="theme" cssClass="fieldError"/>
		<form:input path="theme" id="theme" cssClass="text large"/>
    </li>
    <li>
        <toastmaster:label styleClass="desc" key="agenda.phrase"/>
        <form:errors path="phrase" cssClass="fieldError"/>
        <form:input path="phrase.phrase" id="phrase" cssClass="text large"/>
    </li>
    
    <li>
        <toastmaster:label styleClass="desc" key="agenda.phrase_definition"/>
        <form:errors path="phrase" cssClass="fieldError"/>
        <form:input path="phrase.definition" id="phrase" cssClass="text large"/>
    </li>
    
    <li>
        <toastmaster:label styleClass="desc" key="agenda.phrase_example"/>
        <form:errors path="phrase" cssClass="fieldError"/>
        <form:input path="phrase.example" id="phrase" cssClass="text large"/>
    </li>

 <li>
	<div>
	    <div class="left">
		<toastmaster:label styleClass="desc" key="agenda.president"/>
		<c:import url="/common/toastmasterList.jsp">
		    <c:param name="role" value="role_president"/>
		    <c:param name="user" value="${role_president}"/>
		</c:import>
	    </div>
	    <div>
		<toastmaster:label styleClass="desc" key="agenda.toastmaster"/>
		<c:import url="/common/toastmasterList.jsp">
		    <c:param name="role" value="role_toastmaster"/>
		    <c:param name="user" value="${role_toastmaster}"/>
		</c:import>
	    </div>
	</div>
    </li>
    
    <li>
	<div>
	<div class="left">
		<toastmaster:label styleClass="desc" key="agenda.table_topic_master"/>
		<c:import url="/common/toastmasterList.jsp">
		    <c:param name="role" value="role_table_topic_master"/>
		    <c:param name="user" value="${role_table_topic_master}"/>
		</c:import>
	</div>
	<div>
	    <toastmaster:label styleClass="desc" key="agenda.general_evaluator"/>
	    <c:import url="/common/toastmasterList.jsp">
		<c:param name="role" value="role_general_evaluator"/>
		<c:param name="user" value="${role_general_evaluator}"/>
	    </c:import>
	</div>
	</div>
    </li>
    
    <li><div>
	    <div class="left">
		<toastmaster:label styleClass="desc" key="agenda.speaker1"/>
		<c:import url="/common/toastmasterList.jsp">
		    <c:param name="role" value="role_speaker1"/>
		    <c:param name="user" value="${role_speaker1}"/>
		</c:import>
	    </div>
	    <div>
		<toastmaster:label styleClass="desc" key="agenda.evaluator1"/>
		<c:import url="/common/toastmasterList.jsp">
		    <c:param name="role" value="role_evaluator1"/>
		    <c:param name="user" value="${role_evaluator1}"/>
		</c:import>
	    </div>
    </div></li>
    
    
    <li><div>  
	    <div class="left">
		<toastmaster:label styleClass="desc" key="agenda.speaker2"/>
		<c:import url="/common/toastmasterList.jsp">
		    <c:param name="role" value="role_speaker2"/>
		    <c:param name="user" value="${role_speaker2}"/>
		</c:import>
	    </div>
	    <div>
		<toastmaster:label styleClass="desc" key="agenda.evaluator2"/>
		<c:import url="/common/toastmasterList.jsp">
		    <c:param name="role" value="role_evaluator2"/>
		    <c:param name="user" value="${role_evaluator2}"/>
		</c:import>
	    </div>
    </div> </li>
 
    <li>
	<div>
	    <div class="left">
		<toastmaster:label styleClass="desc" key="agenda.speaker3"/>
		<c:import url="/common/toastmasterList.jsp">
		    <c:param name="role" value="role_speaker3"/>
		    <c:param name="user" value="${role_speaker3}"/>
		</c:import>
	    </div>  
	    <div>
		<toastmaster:label styleClass="desc" key="agenda.evaluator3"/>
		<c:import url="/common/toastmasterList.jsp">
		    <c:param name="role" value="role_evaluator3"/>
		    <c:param name="user" value="${role_evaluator3}"/>
		</c:import>
	    </div>
	</div>
    </li>
    
        <li><div><div class="left">
	<toastmaster:label styleClass="desc" key="agenda.grammarian"/>
	<c:import url="/common/toastmasterList.jsp">
	    <c:param name="role" value="role_grammarian"/>
	    <c:param name="user" value="${role_grammarian}"/>
	</c:import>
    </div>  <div>
	<toastmaster:label styleClass="desc" key="agenda.secretary"/>
	<c:import url="/common/toastmasterList.jsp">
	    <c:param name="role" value="role_secretary"/>
	    <c:param name="user" value="${role_secretary}"/>
	</c:import>
	</div></div>
    </li>
    
    
    <li><div><div class="left">
	<toastmaster:label styleClass="desc" key="agenda.timer"/>
	<c:import url="/common/toastmasterList.jsp">
	    <c:param name="role" value="role_timer"/>
	    <c:param name="user" value="${role_timer}"/>
	</c:import>
	</div>  <div>
	<toastmaster:label styleClass="desc" key="agenda.ah_counter"/>
	<c:import url="/common/toastmasterList.jsp">
	    <c:param name="role" value="role_ah_counter"/>
	    <c:param name="user" value="${role_ah_counter}"/>
	</c:import>
	</div></div>
    </li>  
    
    <li><div><div class="left">
	<toastmaster:label styleClass="desc" key="agenda.vote_counter"/>
	<c:import url="/common/toastmasterList.jsp">
	    <c:param name="role" value="role_vote_counter"/>
	    <c:param name="user" value="${role_vote_counter}"/>
	</c:import>
    </div>  <div>
	<toastmaster:label styleClass="desc" key="agenda.vedio_operator"/>
	<c:import url="/common/toastmasterList.jsp">
	    <c:param name="role" value="role_video_operator"/>
	    <c:param name="user" value="${role_video_operator}"/>
	</c:import>
	</div></div>
    </li>
     
    <li class="buttonBar bottom">
	<c:out value="${buttons}" escapeXml="false"/>
    </li>
</ul>
</form:form>

<script type="text/javascript">
    Form.focusFirstElement($('agendaForm'));
</script>

<v:javascript formName="agenda" cdata="false" dynamicJavascript="true" staticJavascript="false"/>

